namespace EFmodel
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class WTDbContext : DbContext
    {
        public WTDbContext()
            : base( "name=WTdemo" )
        {
        }

        public virtual DbSet<Role> Role { get; set; }
        public virtual DbSet<User> User { get; set; }
        public virtual DbSet<UserRole> UserRole { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Role>()
                .Property( e => e.Name )
                .IsUnicode( false );

            modelBuilder.Entity<User>()
                .Property( e => e.UserName )
                .IsUnicode( false );

            modelBuilder.Entity<User>()
                .Property( e => e.Password )
                .IsUnicode( false );
        }
    }
}
